from django.conf.urls import patterns, include, url
from django.contrib import admin
from lwWeb import views
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = patterns('',
                       # Examples:
                       # url(r'^$', 'lwWeb.views.home', name='home'),
                       # url(r'^blog/', include('blog.urls')),

                       url(r'^blog/',
                           include('blog.urls', namespace='blog')),
                       url(r'^media/ajaxUpload/$',
                           views.handle_uploaded_file),
                       url(r'^ajaxUpload/$',
                           views.handle_uploaded_file),
                       #                        url(r'^cors/upload/base64Upload/',
                       #                            views.handle_uploaded_file),
                       url(r'^admin/', include(admin.site.urls)),
                       )

if settings.DEBUG:
    urlpatterns += patterns('',
                            url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
                                {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
                            )